package com.hsxc.cdz.monitor.bean.pile.v1_33;

import com.hsxc.cdz.base.util.BytesUtil;

/**
 * 
 * @author 陈钊
 *  直流桩充电桩上送充电开始的报文类
 *
 */
public class ChargePileMsg extends PileMessage {

	private int chargePort; // 充电口号
	private int controll; // 控制类型
	private int limitData; // 开启限制数据
	private String OntimeStart; // 定时启动
	private String CardNum; // 用户卡号
	private String identityNum; // 车辆识别号是arsII码
	private int batteryType;// 电池类型
	private String batteryProducer;// 电池生产厂家 是arsII码
	private int batteryCapacity;// 电池额定容量
	private int batteryVoltage;// 电池额定电压
	private int chargeCount;// 电池充电次数
	private int batteryMaxVoltage;// 单体动力蓄电池最高允许充电电压
	private int chargeElectricity;// 电池充电电流
	private int AllEMarked;// 动力蓄电池标称总能量
	private int MaxPermitVoltage;// 最高允许充电总电压
	private int MaxTemp;// 最高允许充电温度
	private int SOCBegin;// 起始SOC%
	private int AllCarVoltage;// 整车动力蓄电池总电压

	public int getChargePort() {
		return chargePort;
	}

	public void setChargePort(int chargePort) {
		this.chargePort = chargePort;
	}

	public int getControll() {
		return controll;
	}

	public void setControll(int controll) {
		this.controll = controll;
	}

	public int getLimitData() {
		return limitData;
	}

	public void setLimitData(int limitData) {
		this.limitData = limitData;
	}

	public String getOntimeStart() {
		return OntimeStart;
	}

	public void setOntimeStart(String ontimeStart) {
		OntimeStart = ontimeStart;
	}

	public String getCardNum() {
		return CardNum;
	}

	public void setCardNum(String cardNum) {
		CardNum = cardNum;
	}

	public String getIdentityNum() {
		return identityNum;
	}

	public void setIdentityNum(String identityNum) {
		this.identityNum = identityNum;
	}

	public int getBatteryType() {
		return batteryType;
	}

	public void setBatteryType(int batteryType) {
		this.batteryType = batteryType;
	}

	public String getBatteryProducer() {
		return batteryProducer;
	}

	public void setBatteryProducer(String batteryProducer) {
		this.batteryProducer = batteryProducer;
	}

	public int getBatteryCapacity() {
		return batteryCapacity;
	}

	public void setBatteryCapacity(int batteryCapacity) {
		this.batteryCapacity = batteryCapacity;
	}

	public int getBatteryVoltage() {
		return batteryVoltage;
	}

	public void setBatteryVoltage(int batteryVoltage) {
		this.batteryVoltage = batteryVoltage;
	}

	public int getChargeCount() {
		return chargeCount;
	}

	public void setChargeCount(int chargeCount) {
		this.chargeCount = chargeCount;
	}

	public int getBatteryMaxVoltage() {
		return batteryMaxVoltage;
	}

	public void setBatteryMaxVoltage(int batteryMaxVoltage) {
		this.batteryMaxVoltage = batteryMaxVoltage;
	}

	public int getChargeElectricity() {
		return chargeElectricity;
	}

	public void setChargeElectricity(int chargeElectricity) {
		this.chargeElectricity = chargeElectricity;
	}

	public int getAllEMarked() {
		return AllEMarked;
	}

	public void setAllEMarked(int allEMarked) {
		AllEMarked = allEMarked;
	}

	public int getMaxPermitVoltage() {
		return MaxPermitVoltage;
	}

	public void setMaxPermitVoltage(int maxPermitVoltage) {
		MaxPermitVoltage = maxPermitVoltage;
	}

	public int getMaxTemp() {
		return MaxTemp;
	}

	public void setMaxTemp(int maxTemp) {
		MaxTemp = maxTemp;
	}

	public int getSOCBegin() {
		return SOCBegin;
	}

	public void setSOCBegin(int sOCBegin) {
		SOCBegin = sOCBegin;
	}

	public int getAllCarVoltage() {
		return AllCarVoltage;
	}

	public void setAllCarVoltage(int allCarVoltage) {
		AllCarVoltage = allCarVoltage;
	}

	@Override
	public void getContentFromByte(byte[] result1) {

		byte[] temp;

		temp = BytesUtil.getByte(0, 1, result1);
		this.setChargePort(BytesUtil.bytesToIntSeq(temp));

		temp = BytesUtil.getByte(1, 1, result1);
		this.setControll(BytesUtil.bytesToIntSeq(temp));

		temp = BytesUtil.getByte(2, 4, result1);
		this.setLimitData(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(6, 4, result1);
		this.setOntimeStart(BytesUtil.bcdBytesToStr(temp));

		temp = BytesUtil.getByte(10, 10, result1);
		this.setCardNum(BytesUtil.bcdBytesToStr(temp));

		temp = BytesUtil.getByte(20, 17, result1);
		this.setIdentityNum(BytesUtil.binBytesToStr(temp));

		temp = BytesUtil.getByte(37, 1, result1);
		this.setBatteryType(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(38, 4, result1);
		// 处理arsc码
		this.setBatteryProducer(BytesUtil.asciiToString(temp.toString()));

		temp = BytesUtil.getByte(42, 2, result1);
		this.setBatteryCapacity(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(44, 2, result1);
		this.setBatteryVoltage(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(46, 3, result1);
		this.setChargeCount(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(49, 2, result1);
		this.setBatteryMaxVoltage(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(51, 2, result1);
		this.setChargeElectricity(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(53, 2, result1);
		this.setAllEMarked(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(55, 2, result1);
		this.setMaxPermitVoltage(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(57, 1, result1);
		this.setMaxTemp(BytesUtil.bytesToIntSeq(temp));

		temp = BytesUtil.getByte(58, 2, result1);
		this.setSOCBegin(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(60, 2, result1);
		this.setAllCarVoltage(BytesUtil.bytesToIntDesc(temp));

	}

}
